package com.njtoyo.taxi.admin.mapper.master.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njtoyo.taxi.admin.library.Const;
import com.njtoyo.taxi.admin.mapper.master.entity.ActivityPrized;
import com.njtoyo.taxi.admin.mapper.master.enums.ActivityPrizedCategory;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Dell
 * @since 2021-07-01
 */
@Repository
@DS(Const.PRIMARY_DS)
public interface ActivityPrizedMapper extends BaseMapper<ActivityPrized> {

    Page<ActivityPrized> selectPage(Page page);

    @Select("SELECT * FROM activity_prized WHERE category = #{category} AND id = #{id}")
    ActivityPrized getActivityById(@Param("category") ActivityPrizedCategory category, @Param("id")Long id);
}
